package backend

import (
	"fmt"

	"file-view/backend/biz"
)

// @Controller
type Router struct{}

func (r *Router) GetPing() {
	fmt.Println("GetPing")
}

func (r *Router) GetFileList(dir string) (fileList []biz.FileInfo, err error) {
	return biz.GetFileList(dir)
}

// @Controller
type FileController struct{}

func (f *FileController) GetFile(fileName string) (fileInfo biz.FileInfo, err error) {
	return biz.GetFileInfo(fileName)
}

func (r *FileController) GetFileList(dir string) (fileList []biz.FileInfo, err error) {
	return biz.GetFileList(dir)
}
